﻿<%@ Page Title="" Language="C#" MasterPageFile="~/POS.master" AutoEventWireup="true" CodeFile="PointOfSales.aspx.cs" Inherits="PointOfSales" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridLookup" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
        .style6
        {
            width: 123px;
        }
        .style12
        {
            width: 100%;
        }
        </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <br /><br />
<br /><br />
    <br /><br /><br /><br /><br /><br /><br />
    <!--start inner_wrap-->
	<div class="inner_wrap">	
		<div class="container_12 clearfix">
		  
		   <!--start content-->
			<section id="content" class="grid_12 clearfix spacer30">
			
				<div class="grid_8 alpha">
				    <article class="article-post"> 
							<div class="blog-meta">
								<span class="left author"><a href="#"><asp:Label ID="DATE" runat="server" 
                                    ForeColor="#0066FF"></asp:Label></a></span>	
								&nbsp;</div>
						</article>
                    <div class="clear"></div>
				    <article class="article-post">  

					</article>	
					<table class="style12">
                        <tr>
                            <td>
                                <br />
                                <br />
                                <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
                                    ClientIDMode="AutoID" CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
                                    CssPostfix="BlackGlass" DataSourceID="SqlDataSource1" KeyFieldName="Pro_ID;Code" 
                                    Width="100%">
                                    <Columns>
                                        <dx:GridViewDataTextColumn FieldName="Pro_ID" ReadOnly="True" VisibleIndex="0" 
                                            Caption="Item ID" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Code" ReadOnly="True" VisibleIndex="1" 
                                            Caption="Item Code" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Brand_Name" 
                                            VisibleIndex="2" Caption="Brand" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Pro_Name" VisibleIndex="3" 
                                            Caption="Item Name" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Pro_Price" 
                                            VisibleIndex="4" Caption="Product Price" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="Ret_Price" Caption="Retail Price" VisibleIndex="5" ShowInCustomizationForm="True">
    <HeaderStyle ForeColor="White" />
</dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Point_Value" VisibleIndex="6" 
                                            Caption="PV" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                        <dx:GridViewDataTextColumn FieldName="Business_Value" VisibleIndex="7" 
                                            Caption="BV" ShowInCustomizationForm="True">
                                            <HeaderStyle ForeColor="White" />
                                        </dx:GridViewDataTextColumn>
                                    </Columns>
                                    <SettingsBehavior AllowSelectByRowClick="True" 
                                        AllowSelectSingleRowOnly="True" />

                                    <SettingsPager PageSize="3" NumericButtonCount="5">
                                    </SettingsPager>
                                    <Settings ShowFilterRow="True" />

                                    <Images SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css">
                                        <LoadingPanelOnStatusBar Url="~/App_Themes/BlackGlass/GridView/gvLoadingOnStatusBar.gif">
                                        </LoadingPanelOnStatusBar>
                                        <LoadingPanel Url="~/App_Themes/BlackGlass/GridView/Loading.gif">
                                        </LoadingPanel>
                                    </Images>
                                    <ImagesFilterControl>
                                        <LoadingPanel Url="~/App_Themes/BlackGlass/Editors/Loading.gif">
                                        </LoadingPanel>
                                    </ImagesFilterControl>
                                    <Styles CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" 
                                        CssPostfix="BlackGlass">
                                        <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                        </Header>
                                        <SelectedRow BackColor="#339966">
                                        </SelectedRow>
                                    </Styles>
                                    <StylesEditors>
                                        <CalendarHeader Spacing="1px">
                                        </CalendarHeader>
                                        <ProgressBar Height="25px">
                                        </ProgressBar>
                                    </StylesEditors>
                                </dx:ASPxGridView>
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:MainConnStr %>" 
                                    
                                    SelectCommand="SELECT [Pro_ID], [Code], [Brand_Name], [Pro_Name], [Pro_Price], [Ret_Price], [Point_Value], [Business_Value] FROM [Tbl_Product] WHERE ([Status] = @Status)">
                                    <SelectParameters>
                                        <asp:Parameter DefaultValue="Show" Name="Status" Type="String" />
                                    </SelectParameters>
                                </asp:SqlDataSource>
                                <br />
                                <dx:ASPxButton ID="Add" runat="server" ClientIDMode="AutoID" 
                                    CssFilePath="~/App_Themes/BlackGlass/{0}/styles.css" CssPostfix="BlackGlass" 
                                    onclick="Add_Click" SpriteCssFilePath="~/App_Themes/BlackGlass/{0}/sprite.css" 
                                    Text="ADD" Width="60px">
                                </dx:ASPxButton>
                                &nbsp;<br />
                                <asp:Label ID="error" runat="server" Font-Bold="True" ForeColor="Red"></asp:Label>
                                
                                <br />
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <a id="cartgrid0">
                                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    BackColor="White" BorderColor="#999999" 
    BorderStyle="Solid" BorderWidth="1px" 
                    CellPadding="3"
                   
                    ForeColor="Black" GridLines="Vertical" Width="100%" onrowdeleting="GridView1_RowDeleting" 
                                    onrowediting="GridView1_RowEditing" 
    onrowupdating="GridView1_RowUpdating" 
    onrowcancelingedit="GridView1_RowCancelingEdit" 
                                
                    >
                                            <AlternatingRowStyle BackColor="#CCCCCC" />
                                            <Columns>
                                                <asp:BoundField DataField="ID" HeaderText="Product ID" ReadOnly="True" />
                                                <asp:BoundField DataField="Code" HeaderText="Product Code" 
                            ReadOnly="True" />
                                                <asp:BoundField DataField="Name" HeaderText="Product Name" 
                            ReadOnly="True" />
                                                <asp:BoundField DataField="Price" HeaderText="Product Price" 
                            ReadOnly="True" />
                                                <asp:BoundField DataField="PV" HeaderText="Product PV" 
                            ReadOnly="True" />
                                                <asp:BoundField DataField="BV" HeaderText="Product BV" 
                            ReadOnly="True" Visible="False" />
                                                <asp:TemplateField HeaderText="Quantity">
                                                    <EditItemTemplate>
                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Quantity") %>'></asp:TextBox>
                                                    </EditItemTemplate>
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("Quantity") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:CommandField ShowEditButton="True" />
                                                <asp:CommandField ShowDeleteButton="True" />
                                            </Columns>
                                            <FooterStyle BackColor="#CCCCCC" />
                                            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" 
                        HorizontalAlign="Left" />
                                            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                            <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                            <SortedAscendingHeaderStyle BackColor="#808080" />
                                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                            <SortedDescendingHeaderStyle BackColor="#383838" />
                                        </asp:GridView>
                                        </a>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <a id="cartgrid">

                                <asp:Label ID="Label4" runat="server"></asp:Label>
    </a>

        <asp:Label ID="repid" runat="server" Visible="False"></asp:Label>

            <asp:Label ID="Label5" runat="server"></asp:Label>

                                <asp:Label ID="Label7" runat="server" Visible="False"></asp:Label>

                             </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:GridView ID="GridView2" runat="server" BackColor="White" 
                                    BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" 
                                    ForeColor="Black" GridLines="Vertical" Width="100%">
                                    <AlternatingRowStyle BackColor="#CCCCCC" />
                                    <FooterStyle BackColor="#CCCCCC" />
                                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                    <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
                                    <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                    <SortedAscendingHeaderStyle BackColor="#808080" />
                                    <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                    <SortedDescendingHeaderStyle BackColor="#383838" />
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Width="42px" />

                             </td>
                        </tr>
                    </table>
					<div class="clear">
                            <asp:Label ID="Label1" runat="server" Visible="false"></asp:Label>
						</div>
					<!-- blog navigation -->
					<!-- end of blog navigation -->						
				</div>
	
<%--				<div class="grid_4 omega sidebar-right">--%>
					<div class="asidex">	
			
						<div class="sidebar-widget">
							<h5>&nbsp;</h5>  
								<ul class="sidebar-list">
									<li><dx:ASPxButton ID="Checkout" runat="server" Text="Checkout" 
                                            ClientIDMode="AutoID" CssFilePath="~/App_Themes/SoftOrange/{0}/styles.css" 
                                            CssPostfix="SoftOrange" 
                                            SpriteCssFilePath="~/App_Themes/SoftOrange/{0}/sprite.css" Width="100px" 
                                            onclick="ASPxButton1_Click"></dx:ASPxButton></li>
                                            <li></li>
									<li><dx:ASPxButton ID="PrintButton" runat="server" Text="Print" 
                                            ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
                                            CssPostfix="Office2003Olive" 
                                            SpriteCssFilePath="~/App_Themes/Office2003Olive/{0}/sprite.css" 
                                            Width="100px" onclick="ASPxButton2_Click"></dx:ASPxButton></li>
                                            <li></li>
									<li><dx:ASPxButton ID="ASPxButton3" runat="server" Text="Cancel" 
                                            ClientIDMode="AutoID" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                            CssPostfix="Office2003Blue" 
                                            SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css" 
                                            Width="100px" onclick="ASPxButton3_Click"></dx:ASPxButton></li>
<%--									<li><a href="#">Front end applications<span>(32)</span></a></li>--%>
								</ul>
						</div>
						<div class="sidebar-widget">
                        <table style="color: #0000FF; width: 98%;">
                        <tr>
                                <td>Total Amount</td>
						        <td style="background-color: #F5F5F6">
                                    <asp:Label ID="TOTAMOUNT" runat="server" 
                                        Visible="False" Font-Size="Large" ForeColor="Black"></asp:Label></td>
                         </tr>
                         <tr>
                                <td>Total PV</td>
                                <td>
                                    <asp:Label ID="TOTPV" runat="server"></asp:Label>
                                </td>
                         </tr>
                         <tr>
                                <td>Total BV</td>
                                <td>
                                    <asp:Label ID="TOTBV" runat="server"></asp:Label>
                                </td>
                         </tr>
                          <tr>
                                <td>Total Discount</td>
                                <td>
                                    <asp:Label ID="TOTDIS" runat="server"></asp:Label>
                                </td>
                         </tr>
                          <tr>
                                <td>Retail Amount</td>
                                <td>
                                    <asp:Label ID="TOTRETAIL" runat="server"></asp:Label>
                                </td>
                         </tr>
                         <tr>
                                <td>Total Quantity</td>
                                <td>
                                    <asp:Label ID="TOTQTY" runat="server"></asp:Label>
                                </td>
                         </tr>
                         <tr>
                                <td colspan="2">
                                    <asp:Label ID="Label6" runat="server" Font-Bold="True" Font-Size="Larger" 
                                        Text="Balance"></asp:Label>
                                </td>
                         </tr>
                         <tr>
                                <td>Total</td>
                                <td>
                                    <asp:Label ID="TOT" runat="server" 
                                        Visible="False" Font-Size="X-Large" ForeColor="Black"></asp:Label>
                                </td>
                         </tr>
                         <tr>
                                <td>Amount</td>
                                <td>
                                    <asp:TextBox ID="amount" runat="server" AutoPostBack="True" 
                                        ontextchanged="TextBox2_TextChanged"></asp:TextBox>
                                </td>
                         </tr>
                         <tr>
                                <td>Balance</td>
                                <td>
                                    <asp:Label ID="BALANSlBL" runat="server" Font-Bold="True" Font-Size="Medium"></asp:Label>
                                </td>
                         </tr>
                       </table>
						</div>	
						
					</div>
<%--				</div>--%>
				
			</section>
		</div>
  	</div>
	<!--end inner_wrap-->
   
</asp:Content>

